<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3913543344,4199636285&fm=26&gp=0.jpg" alt="" style="display: none;"> -->

    <!-- <script src="./preload.js" defer></script> -->

    <script>
        let xhr = new XMLHttpRequest()

        xhr.onreadystatechange = callback
        xhr.onprogress = progressCallback
        xhr.open('Get', 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3913543344,4199636285&fm=26&gp=0.jpg', true)
        xhr.send()

        function callback() {
            if(xhr.readyState == 4 && xhr.status == 200) {
                let res = xhr.responseText
            }
            else {
                console.log(xhr.statusText);
            }
        }

        function progressCallback(e) {
            e = e || event
            if(e.lengthComputable) {
                console.log('success');
            }
        }
    </script>
</body>
</html>